package rolesystem.core;

import java.io.Serializable;

/**
 * This class represents an event occurred to a registration.
 * Instances of this class are constant, once created they cannot be changed.
 */
public class RoleEvent implements Serializable
{
	/**
	 * Name of this event.
	 */
	private String name;

	/**
	 * Identifier of the sender of this event.
	 */
	private int sender;

	/**
	 * Role of the sender of this event.
	 */
	private String senderRole;

	/**
	 * Informative content of this event (if any).
	 */
	private Serializable content;


	/**
	 * Constructor with no arguments, for serializability.
	 */
	private RoleEvent()
	{
	}

	
	/**
	 * @param name Name of this event.
	 * @param sender Identifier of the sender of this event.
	 * @param senderRole Role of the sender of this event.
	 * @param content Informative content of this event.
	 */
	public RoleEvent(String name, int sender, String senderRole,
		Serializable content)
	{
		this.name=name;
		this.sender=sender;
		this.senderRole=senderRole;
		this.content=content;
	}


	/**
	 * Returns the name of this event.
	 * @return The name of this event.
	 */
	public String getName()
	{
		return name;
	}


	/**
	 * Returns the identifier of the sender of this event.
	 * @return The identifier of the sender of this event.
	 */
	public int getSender()
	{
		return sender;
	}


	/**
	 * Returns the role of the sender of this event.
	 * @return The role of the sender of this event.
	 */
	public String getSenderRole()
	{
		return senderRole;
	}


	/**
	 * Returns the informative content of this event.
	 * @return The informative content of this event.
	 */
	public Serializable getContent()
	{
		return content;
	}
}
